#!/bin/sh

if [ -f /var/run/rsyncd.pid ] ; then
  kill `cat /var/run/rsyncd.pid`
else
  killall rsync 2>/dev/null
fi

rm -f /var/run/rsyncd.pid

[ -e %OPTWARE_TARGET_PREFIX%/etc/default/rsync ] && . %OPTWARE_TARGET_PREFIX%/etc/default/rsync

if ${RSYNC_ENABLE} ; then
  %OPTWARE_TARGET_PREFIX%/bin/rsync --daemon ${RSYNC_OPTS}
fi
